
<template>
  <div class="evaluationInfo_container">
      <basicinfo :form-data="form"></basicinfo>
    <el-card class="box-card" shadow="always" style="background:#FAFAFA;margin-top: 20px">
      <template #header>
        <div class="card-header" style="padding-bottom: 4px">
          <span>评估项目</span>

        </div>
      </template>
        <div>
               <div v-for="(item,index) in form.evaluationItemSelectedList" :key="index">
                 <el-table  :data="item.evaluationItemOptionSelectedList" stripe border >
                   <el-table-column>
                     <template #header>
                        <span>{{item.name}}</span>
                     </template>
                     <template #default="scope">
                       <span>{{scope.row.score}}分, {{scope.row.name}}</span>
                     </template>
                   </el-table-column>
                 </el-table>
               </div>
        </div>
    </el-card>
    <div style="text-align: right;margin-top: 30px;margin-right: 30px">
      <el-button @click="cancel">返 回</el-button>
    </div>
  </div>
</template>

<style scoped lang="scss" name="evalutationinfo">
   .evaluationInfo_container{
     padding: 20px;
   }
</style>
<script setup>
const { proxy } = getCurrentInstance();
const router = useRouter();
const route = useRoute();
import {getEvaluationReport} from  '@/api/homebedsign/index'
import basicinfo from './basicinfo.vue'

const data = reactive({
  form: {},

});

const {  form} = toRefs(data);

const tableData=ref([{
    name:'进食',
    evaluationItemOptionList:[{
      name:'独立使用器具将食物送进口中并咽下,没有呛咳',
      score:1
    }]
  },
    {
      name:'进食',
      evaluationItemOptionList:[{
        name:'独立使用器具将食物送进口中并咽下,没有呛咳',
        score:1
      }]
    }])
  function cancel(){
    router.go(-1)
  }

 function  EvaluationReport(data){
   getEvaluationReport(data).then(res=>{
    form.value=res.evaluationReport
     console.log('2222222222222222',form.value)

   })
  }
const stopWatch = watch(
    () => route,
    (newVal, oldVal) => {
       console.log('wwwwwwww',newVal.params.id)
      EvaluationReport(newVal.params.id)
    },
    { immediate: true }
);

onBeforeUnmount(() => {
  stopWatch();
});
</script>
